home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 3
/
003.d81
/
rate exchange
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
6KB
|
221 lines
10 rem ascoreign lenurrency lenonversion (NULL)rogram by (NULL)ichael atn. chr$ranger
20 rem (NULL)ranslated for the lenommodore 64 by str$onna (NULL). (NULL)oody
30 :
40 rem set colors
50 :
60 poke53280,8:rem set border color to orange
70 poke53281,15:rem set background color to gray 3
80 poke53272,23: rem selects upper/lower case
90 printchr$(8):rem disables c/shift key
100 printchr$(144):rem set character color to black
110 :
120 :
130 rem dimension and read data statements
140 dimcu(1000),a$(1000),n$(20),m$(20)
150 forx=1to12:readn$(x):next
160 forx=1to11:readm$(x):next
170 :
180 rem goto title page & first screen
190 :
200 goto1050
210 :
220 rem calculations
230 :
240 printchr$(147)
250 print" [208][204][197][193][211][197][160][215][193][201][212]. [196][207][201][206][199][160][195][193][204][195][213][204][193][212][201][207][206][211]."
260 ifm$="p"thenprint" [201][206][198][207][210][205][193][212][201][207][206][160][215][201][204][204][160][194][197][160][207][213][212][208][213][212][160][212][207][160][208][210][201][206][212][197][210]."
270 ifm$="p"thengosub1720
280 ifa=2ora=8thener=er/10
290 ifa=6thener=er/100
300 ifa=3thener=1/er
310 ifr$="b"then520
320 forx=1to9:cu(x)=x/er:gosub840:gosub930:next
330 forx=10to100step10:cu(x)=x/er:gosub840:gosub930:next
340 ifm$="p"thengosub1820:goto380
350 printchr$(147):printtab(2);n$(a)
360 printtab(2);c$;tab(16);"$"
370 printtab(2);:fori=1to17:print"-";:nexti:print
380 ifa=6andm$="p"thengosub2150:goto420
390 ifa=6thenforx=100to900step100:printtab(4);x;tab(9);a$(x/100):next
400 ifa=6thenforx=1000to9000step1000:printtab(3);x;tab(9);a$(x/100):next
410 ifa=6thenprinttab(3);"10000";tab(9);a$(100)
420 ifa=6thengoto520
430 ifm$="p"thengosub1940:goto470
440 ifa=2ora=8thenforx=10 to 90 step 10 :printtab(4);x;tab(9);a$(x/10):next
450 ifa=2ora=8thenforx=100to 900step 100:printtab(3);x;tab(9);a$(x/10):next
460 ifa=2ora=8thenprinttab(3);"1000";tab(9);a$(100)
470 ifa=2ora=8thener=er*10:goto520
480 ifm$="p"thengosub2000:goto520
490 forx=1to9:printtab(4);x;tab(9);a$(x):next
500 forx=10to90step10:printtab(3);x;tab(9);a$(x):next
510 printtab(3);"100";tab(9);a$(100)
520 ifm$="p"andr$="a"thengoto670
530 ifa=6thener=er*100
540 ifr$="a"then690
550 ifr$="c"thenforxz=1to22:print"[145]";:nextxz
560 forx=1to9:cu(x)=x*er:gosub840:gosub930:next
570 forx=10to100step10:cu(x)=x*er:gosub840:gosub930:next
580 ifm$="p"thengosub2060:goto670
590 ifr$="c"then610
600 printchr$(147)
610 printtab(20-len(n$(a))+h);n$(a)
620 printtab(h+6);"$";tab(20-len(c$)+h);c$
630 printtab(h+3);:fori=1to17:print"-";:nexti:print
640 forx=1to9:printtab(h+5);x;tab(h+10);a$(x):next
650 forx=10to90step10:printtab(h+4);x;tab(h+10);a$(x):next
660 printtab(h+4);"100";tab(h+10);a$(100)
670 close4
680 ifm$="p"thenprint""
690 print"[208]ress space bar to continue";
700 poke204,0:poke207,0:getx$:ifx$=""then700
710 poke204,1
720 printchr$(147)
730 print"[195]alculate another rate? ";
740 poke204,0:poke207,0:getx$:ifx$=""then740
750 poke204,1:printx$
760 ifx$="y"then1140
770 ifx$="n"then800
780 ifx$<>"y"orx$<>"n"thenzz=1:zy=1:gosub1640:goto730
790 :
800 print"[147]load"chr$(34)"payload"chr$(34)",8":print"run"
810 poke631,13:poke632,13:poke198,2:end
820 rem decimal places and spacing
830 :
840 p=100
850 cu(x)=int((cu(x))*p+.05)/p
860 a$(x)=str$(cu(x))
870 ifint(cu(x))=cu(x)thena$(x)=a$(x)+".00"
880 ifcu(x)=.1orcu(x)=.2orcu(x)=.3or(x)=.4orcu(x)=.5orcu(x)=.6then910
890 ifcu(x)=.7orcu(x)=.8orcu(x)=.9then910
900 ifmid$(a$(x),len(a$(x))-2,1)="."thenreturn
910 a$(x)=a$(x)+"0"
920 return
930 iflen(a$(x))=2thena$(x)=" "+a$(x)
940 iflen(a$(x))=3thena$(x)=" "+a$(x)
950 iflen(a$(x))=4thena$(x)=" "+a$(x)
960 iflen(a$(x))=5thena$(x)=" "+a$(x)
970 iflen(a$(x))=6thena$(x)=" "+a$(x)
980 iflen(a$(x))=7thena$(x)=" "+a$(x)
990 iflen(a$(x))=8thena$(x)=" "+a$(x)
1000 iflen(a$(x))=9thena$(x)=" "+a$(x)
1010 return
1020 :
1030 rem establish parameters
1040 :
1050 printchr$(147):printchr$(129):printtab(2)"[198][207][210][197][201][199][206][160][195][213][210][210][197][206][195][217][160][195][207][206][214][197][210][211][201][207][206][160][208][210][207][199][210][193][205]"
1060 printchr$(144)
1070 printtab(18)"by"
1080 printtab(10)"[205]ichael [193]. [199]ranger"
1090 printtab(5)"[212]ranslated by [196]onna [203]. [215]oody"
1100 printtab(6)"[208]ress space bar to continue";
1110 printtab(35):poke204,0:poke207,0:getz$
1120 ifz$=""then1110
1130 poke204,1
1140 printchr$(147):print"[198]or what currency do you want a table?"
1150 print
1160 forx=1to9:print" ";x;". ";n$(x);:printtab(20)m$(x):nextx
1170 forx=10to12:printx;". ";n$(x);:printtab(20)m$(x):nextx
1180 print:poke 19,32:input"[197]nter selection: ";x$:print
1190 a=val(x$)
1200 ifa<1ora>12thenzz=15:zy=14:gosub1640:goto1180
1210 ifa=1thenc$=m$(1):goto1380
1220 ifa=2thenc$=m$(2):goto1380
1230 ifa=3thenc$=m$(3):goto1330
1240 ifa=4thenc$=m$(4):goto1380
1250 ifa=5thenc$=m$(5):goto1380
1260 ifa=6thenc$=m$(6):goto1380
1270 ifa=7thenc$=m$(7):goto1380
1280 ifa=8thenc$=m$(8):goto1380
1290 ifa=9thenc$=m$(9):goto1380
1300 ifa=10thenc$=m$(10):goto1380
1310 ifa=11thenc$=m$(11):goto1380
1320 ifa=12theninput"[197]nter the currency: ";c$:goto1380
1330 printchr$(147)
1340 ifa=3thenprint:print"[215]hat is the exchange rate?":print
1350 input"1 pound = $[160]";er$:er=val(er$):print:print
1360 ifer<=0thenzz=4:zy=3:gosub1640:goto1350
1370 goto1430
1380 printchr$(147)
1390 print:print"[215]hat is the exchange rate?"
1400 print:print"$1.00 = ";c$
1410 input"[145]";er$:er=val(er$):print:print
1420 ifer<=0thenzz=4:zy=0:gosub1640:goto1390
1430 printtab(5)"[196]o you want to see"
1440 print
1450 printtab(10);"[193]. ";c$;" to $"
1460 printtab(10)"[194]. $ to ";c$
1470 printtab(10)"[195]. [194]oth":print:print:print
1480 r$="":h=0
1490 print"[197]nter selection: ";r$;
1500 poke204,0:poke207,0:getr$:ifr$=""then1500
1510 poke204,1:printr$
1520 ifr$="a"orr$="b"orr$="c"then1540
1530 zz=13:zy=13:gosub1640:goto1480
1540 m$="":print"<[211]>creen or <[208]>rinter[160]";m$;
1550 poke204,0:poke207,0:getm$:ifm$=""then1550
1560 poke204,1:printm$
1570 ifm$="s"orm$="p"then1590
1580 zz=17:zy=14:gosub1640:goto1540
1590 ifr$="c"thenh=18
1600 goto240
1610 :
1620 rem error trapping response
1630 :
1640 forxz=1to20-zz:print"";:nextxz
1650 print"[211]orry. [217]ou made an incorrect entry [208]lease re-enter."
1660 forxz=1to23-zy:print"[145]";:nextxz
1670 return
1680 :
1690 rem turn on printer
1700 rem if you want special type on printout, enter commands here
1710 :
1720 :
1730 open4,4,7
1740 return
1750 data"[193]ustrian","[194]elgian","[194]ritish","[196]anish","[198]rench","[201]talian","[196]utch"
1760 data"[211]panish","[211]wedish","[211]wiss","[215]est [199]erman","[207]ther"
1770 data"[211]chilling","[198]rancs","[208]ounds","[203]rone","[198]rancs","[204]ira","[199]uilders"
1780 data"[208]esetas","[203]rone","[198]rancs","[205]arks"
1790 :
1800 rem send to printer
1810 :
1820 print#4
1830 print#4
1840 print#4,chr$(16)"02"n$(a)
1850 print#4,chr$(16)"02"c$;chr$(16)"16""$"
1860 print#4," -----------------"
1870 return
1880 ifa=6thenforx=100to900step100:print#4,chr$(16)"04"x;
1890 print#4,chr$(16)"09"a$(x/100):next
1900 ifa=6thenforx=1000to9000step1000:print#4,chr$(16)"03"x;
1910 ifa=6thenprint#4,chr$(16)"09"a$(x/100):next
1920 ifa=6thenprint#4,chr$(16)"03""10000";chr$(16)"09"a$(100)
1930 return
1940 ifa=2ora=8thenforx=10to90step10:print#4,chr$(16)"04"x;
1950 ifa=2ora=8thenprint#4,chr$(16)"09"a$(x/10):next
1960 ifa=2ora=8thenforx=100to900step100:print#4,chr$(16)"03"x;
1970 ifa=2ora=8thenprint#4,chr$(16)"09"a$(x/10):next
1980 ifa=2ora=8thenprint#4,chr$(16)"03""1000";chr$(16)"09"a$(100)
1990 return
2000 forx=1to9:print#4,chr$(16)"04"x;chr$(16)"09"a$(x):next
2010 forx=10to90step10
2020 print#4,chr$(16)"03"x;
2030 print#4,chr$(16)"09"a$(x):next
2040 print#4,chr$(16)"03""100";chr$(16)"09"a$(100)
2050 return
2060 print#4:print#4:print#4
2070 cmd4:printtab(20-len(n$(a)));n$(a);
2080 print#4,chr$(16)"06""$";
2090 cmd4:printtab(20-len(c$));c$
2100 print#4,chr$(16)"03""------------------"
2110 forx=1to9:print#4,chr$(16)"05"x;chr$(16)"10"a$(x):next
2120 forx=10to90step10